package com.dc.chat.entity.to;

import lombok.Data;

@Data
public class ResponseBean <T>{
    private int code;
    private String message;
    private T data;
    public static <T> ResponseBean success(String message,T data){
        ResponseBean responseBean=new ResponseBean();
        responseBean.setCode(200);
        responseBean.setMessage(message);
        responseBean.setData(data);
        return responseBean;
    }
    public static ResponseBean failed(String message){
        ResponseBean responseBean=new ResponseBean();
        responseBean.setCode(500);
        responseBean.setMessage(message);
        return responseBean;
    }
}
